package com.feng.shiro.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.feng.shiro.bean.User;
import com.feng.shiro.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
/**
 * java.lang.IllegalStateException: Failed to load ApplicationContext
 * Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException:
 *      Error creating bean with name 'shiroFilterFactoryBean' defined in class path resource
 *      [com/feng/shiro/config/ShiroConfig.class]: Unsatisfied dependency expressed through method
 *      'shiroFilterFactoryBean' parameter 0; nested exception is org.springframework.beans.factory
 *      .UnsatisfiedDependencyException: Error creating bean with name 'defaultWebSecurityManager'
 *      defined in class path resource [com/feng/shiro/config/ShiroConfig.class]: Unsatisfied dependency
 *      expressed through method 'getDefaultWebSecurityManager' parameter 0; nested exception is org
 *      .springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name
 *      'userRealm': Unsatisfied dependency expressed through field 'userservice'; nested exception is
 *      org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'userServiceImpl' is
 *      expected to be of type 'com.feng.shiro.service.UserServiceImpl' but was actually of type 'com.sun.proxy.$Proxy70'
 *
 */
//public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService{
public class UserServiceImpl implements UserService{
    @Autowired
    UserMapper mapper;
    @Override
    public User queryUserByName(String username) {
        User user = mapper.queryUserByName(username);
        return user;
    }
}
